<template>
  <div class="newmuse">
    <Newmuse :list="tuijianlist" :name="hotname" />
    <Newmuse :list="alllist" :name="allname" />
  </div>
</template>

<script>
import Newmuse from "@/components/newmuses.vue/Newmuse.vue";
import { Getnewdie, Newdetuijian, GetAllnewdie } from "@/request/api";
export default {
  data() {
    return {
      // 热门新碟
      tuijianlist: [],
      hotname: ["", "热门新碟"],
      // 全部新碟
      alllist: [],
      allname: ["|", "全部新碟", "全部", "华语", "欧美", "韩国", "日本"],
    };
  },
  created() {
    Newdetuijian().then((res) => {
      if (res.data.code === 200) {
        this.tuijianlist = res.data.albums;
        this.tuijianlist = this.tuijianlist.filter((item, index) => {
          return index < 10 ? item : null;
        });
      }
    });
    GetAllnewdie({ limit: 35, area: "ALL" }).then((res) => {
      if (res.data.code === 200) {
        this.alllist = res.data.albums;
      }
    });
    // limit : 返回数量 , 默认为 30
    // offset : 偏移数量，用于分页 , 如 :( 页数 -1)*30, 其中 30 为 limit 的值 , 默认为 0
    // area : ALL:全部,ZH:华语,EA:欧美,KR:韩国,JP:日本
  },
  components: {
    Newmuse,
  },
};
</script>
 
<style lang = "less" scoped>
@import "@/assets/base.less";
.newmuse {
  width: 1000px;
  margin: 0 auto;
  border-left: 1px solid #ccc;
  border-right: 1px solid #ccc;
}
</style>